﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EasyClass {
	public partial class IssueTaskForm : Form {
		Controller controller;

		public IssueTaskForm(Controller c) {
			/*InitializeComponent();
			controller = c;
			controller.SetIssueTaskForm(this);

			comboBox1.Items.AddRange(controller.GetAllTasksName());
			string taskName = controller.GetSelectedTaskName();
			if (taskName != "") comboBox1.SelectedItem = taskName;
			Control.CheckForIllegalCrossThreadCalls = false;*/
		}

		public void AddReceived() {
			label4.Text = (Int32.Parse(label4.Text) + 1).ToString();
		}

		public void AddSubmitted() {
			label5.Text = (Int32.Parse(label5.Text) + 1).ToString();
		}

		private void IssueTaskForm_Load(object sender, EventArgs e) {

		}
		
		private void button1_Click(object sender, EventArgs e) {
			/*if (comboBox1.SelectedItem.ToString() != "") {
				comboBox1.Enabled = false;
				controller.IssueTask(comboBox1.SelectedItem.ToString());
			} else {
				MessageBox.Show("No task selected!");
			}*/
		}

		private void button2_Click(object sender, EventArgs e) {
			//int right, wrong;
			//Result result = controller.JudgeAnswers(comboBox1.SelectedText);
			//MessageBox.Show("right: " + right + "wrong: " + wrong);
			string fileName = controller.CreateTxtLog(comboBox1.SelectedItem.ToString());
			System.Diagnostics.Process.Start("notepad.exe", fileName);
			this.Close();
		}
	}
}
